/*
CREDITS:
Random Name Generator - this gun name is actually quite spiffy!
Original Quadshot - Logan
Beatiful angled Quadshot sprite - Cage!i!i!i!i!i! (added those !'s and i's on his special request - I owe him after all. :P)
NeuralStunner - Three-dimensional recoil
Fire sound - Propably Killing Floor, but I'm not sure. Ripped by Uboa. Great thanks for that, it adds insane amount of kick to the gun!
I am not quite sure from where are rest sounds; which game are the original sounds, but those are modified ones from NeoCore. Ripped by Sangelothi.
Gunflash - Bane, props to you for this one - it's really damn nice gunflash - it became my new staple one.

Compared to Erasus, it's slower in terms of fire rate, and it doesn't have casing-spewing attachment. It also has horrible recoil,
But that can be used in positive way, since you can use it as a make-shift rocket-jumping device. It also makes up with it's
flaws by shooting twice as much pellets per shot, with even bigger power, and slightly tightened horizontal spread.
Also, it has a nasty ability to deal horribly large damage on point-blank shot. Give Cyberdemon a taste!
*/

ACTOR Quadvolgue : Weapon 24530
{
	//$Category Weapons
	//$Title Quadvolgue
	//$Sprite SSHGX0
	Inventory.PickupMessage "You've got the ''Quadvolgue'' shotgun! Sometimes you need way more gun. (3)"
	Obituary "%o was blown away and smeared on wall by %k's quad shotgun."
	Weapon.UpSound "Quadshot/Up"
	Weapon.SelectionOrder 6
	Weapon.AmmoType "ErasusAmmo"
	Weapon.AmmoUse 4
	Weapon.AmmoGive 16
	Weapon.AmmoType2 "ErasusAmmo"
	Weapon.AmmoUse2 16
	Weapon.SlotNumber 3
	Weapon.Kickback 200
	+NOALERT
	States {
		Spawn: 
			SSHG X -1
			Stop
		Ready:
			SSHG A 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("RO_GotoReload", 1, "Reload")
			Loop
		Select:
			SSHG A 1 A_Raise
			SSHG A 0 A_Raise
			Loop
		Deselect:
			SSHG A 0 A_ZoomFactor(1)
			SSHG A 1 A_Lower
			SSHG A 0 A_Lower
			Loop
		Fire:
			SSHG F 0 Bright A_GunFlash
			SSHG F 0 Bright A_AlertMonsters
			SSHG F 0 Bright A_JumpIfInventory("QuadshotRecoilMode",1,"SupressedRecoilFire")
			SSHG F 0 Bright A_ChangeVelocity (Cos(Pitch) * -29, 0, Sin(Pitch) * 29,CVF_RELATIVE)
			SSHG F 0 Bright A_Quake(6,12,0,32,none)
			Goto ToastyOnSides
		SupressedRecoilFire:
			SSHG F 0 Bright A_ChangeVelocity (Cos(Pitch) * -3, 0, Sin(Pitch) * 3,CVF_RELATIVE)
			SSHG F 0 Bright A_Quake(2,6,0,32,none)
		ToastyOnSides:
			SSHG F 0 Bright A_PlaySound("Quadshot/Fire",1,0.6)
			SSHG F 0 Bright A_GiveInventory("ErasusCasing",4)
			SSHG F 0 Bright A_JumpIfInventory("QuadUpgrade",1,"QuadFire")
			SSHG F 0 Bright A_FireBullets(12.5, 3.75, 60, 40, "ErasusPuff")
			Goto SweetButtercheesusOMine
		QuadFire:
			SSHG A 0 A_SetBlend("Blue",0.05,16)
			SSHG A 0 A_PlaySoundEx("Weapons/QuadShot","Auto")
			SSHG A 0 A_FireBullets(12.5, 3.75, 60, 80, "QuadPuff")
		SweetButtercheesusOMine:	
			//SSHG F 0 Bright A_FireCustomMissile("PointBlankBlast",0,0,0,0)
			SSHG F 0 Bright A_SetAngle(Angle-6)
			SSHG F 0 Bright A_SetPitch(Pitch-4)
			SSHG F 1 Bright A_ZoomFactor(0.95)
			SSHG F 0 Bright A_SetAngle(Angle-3)
			SSHG F 0 Bright A_SetPitch(Pitch-2)
			SSHF B 1 A_ZoomFactor(0.91)
			SSHG F 0 Bright A_SetAngle(Angle-3)
			SSHG F 0 Bright A_SetPitch(Pitch-2)
			SSHF C 1 A_ZoomFactor(0.85)
			SSHG F 0 Bright A_SetAngle(Angle-3)
			SSHG F 0 Bright A_SetPitch(Pitch-2)
			SSHF D 1 A_ZoomFactor(0.82)
			SSHG F 0 Bright A_SetAngle(Angle-1.5)
			SSHG F 0 Bright A_SetPitch(Pitch-1)
			SSHF E 1 A_ZoomFactor(0.8)
			SSHG F 0 Bright A_SetAngle(Angle-1.5)
			SSHG F 0 Bright A_SetPitch(Pitch-1)
			SSHF F 1 A_ZoomFactor(0.82)
			SSHG F 0 Bright A_SetAngle(Angle-1.5)
			SSHG F 0 Bright A_SetPitch(Pitch-1)
			SSHF G 1 A_ZoomFactor(0.84)
			SSHG F 0 Bright A_SetAngle(Angle-1.5)
			SSHG F 0 Bright A_SetPitch(Pitch-1)
			SSHF H 1 A_ZoomFactor(0.87)
			SSHG F 0 Bright A_SetAngle(Angle-0.75)
			SSHG F 0 Bright A_SetPitch(Pitch-0.5)
			SSHF I 1 A_ZoomFactor(0.9)
			SSHG F 0 Bright A_SetAngle(Angle-0.75)
			SSHG F 0 Bright A_SetPitch(Pitch-0.5)
			SSHF J 1 A_ZoomFactor(0.92)
			SSHG F 0 Bright A_SetAngle(Angle-0.375)
			SSHG F 0 Bright A_SetPitch(Pitch-0.25)
			SSHF K 1 A_ZoomFactor(0.94)
			SSHF L 1 A_ZoomFactor(0.96)
			SSHF M 1 A_ZoomFactor(0.97)
			SSHF N 1 A_ZoomFactor(0.98)
			SSHG A 1 A_ZoomFactor(0.99)
			SSHG A 1 A_ZoomFactor(1)
			SSHG A 1 A_CheckReload 
			SSHN ABDEG 1
			SSHO ABDEIK 1
			SSHO M 1 A_PlaySound("Quadshot/Open",5,0.7)
			SSHO NOQRTUWX 1
			SSHL A 3
			SSHL BCDE 1
			SSHL F 1 A_PlaySound("Quadshot/Load",6,0.6)
			SSHL GHIJ 1
			SSHL K 2
			SSHL LMNO 1
			SSHL P 1 A_PlaySound("Quadshot/Load",5,0.6)
			SSHL QRSTU 1
			SSHL V 2
			SSHC ABDE 1
			SSHO R 0 A_PlaySound("Quadshot/Close",6,0.7)
			SSHO RQONKI 1
			SSHN GFDCB 1
			SSHG A 2
			SSHG A 3 A_ReFire
			Goto Ready
		AltFire: //Sweet Jesus on a pogostick.
			SSHN ABCDEFG 1
			SSHO ABCDEFGHIJKLMNOPQR 1
			TNT1 A 15
			TNT1 A 0 A_PlaySound("Quadshot/Deploy",5,0.65)
			SSH4 MLKJIHGFEDCB 1
			SSH4 A 15
			SSH4 A 0 A_ReFire
			Goto UnleashTheRobogopher
		AltHold:
			SSH4 A 5 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
			SSH4 A 0 A_ReFire
		UnleashTheRobogopher:
			SSF4 A 2 Bright
			SSF4 A 0 A_GunFlash
			SSF4 A 0 A_AlertMonsters
			SSF4 A 0 A_JumpIfInventory("QuadshotRecoilMode",1,"SupressedRecoilAltFire")
			SSF4 A 0 A_ChangeVelocity (Cos(Pitch) * -116, 0, Sin(Pitch) * 116,CVF_RELATIVE)
			SSF4 A 0  A_Quake(9,18,0,64,none)
			Goto HolyDoodooEarthquake
		SupressedRecoilAltFire:
			SSF4 A 0 A_ChangeVelocity (Cos(Pitch) * -12, 0, Sin(Pitch) * 12,CVF_RELATIVE)
			SSF4 A 0  A_Quake(3,6,0,18,none)
		HolyDoodooEarthquake:
			SSF4 A 0 A_PlaySound("Quadshot/Fire",1,1.0)
			SSF4 A 0 A_PlaySound("Quadshot/Alt",6,1.0)
			SSF4 A 0 A_GiveInventory("ErasusCasing",16)
			//SSF4 A 0 A_FireCustomMissile("PointBlankSuperDuperHiperBlast",0,0,0,0)
			SSF4 A 0 A_JumpIfInventory("QuadUpgrade",1,"QuadAltFire")
			SSF4 A 0 A_FireBullets(25, 7.5, 240, 40, "ErasusPuff")
			Goto LoadeeHuhOnAPogostick
		QuadAltFire:
			SSHG A 0 A_SetBlend("Blue",0.05,16)
			SSHG A 0 A_PlaySoundEx("Weapons/QuadShot","Auto")
			SSHG A 0 A_FireBullets(25, 7.5, 240, 80, "QuadPuff")
		LoadeeHuhOnAPogostick:
			SSH4 B 1 A_ZoomFactor(0.9)
			SSH4 B 0 A_SetPitch(Pitch-6)
			SSH4 D 1 A_ZoomFactor(0.8)
			SSH4 D 0 A_SetPitch(Pitch-5)
			SSH4 F 1 A_ZoomFactor(0.7)
			SSH4 F 0 A_SetPitch(Pitch-4)
			SSH4 H 1 A_ZoomFactor(0.71)
			SSH4 H 0 A_SetPitch(Pitch-1)
			SSH4 J 1 A_ZoomFactor(0.72)
			SSH4 H 0 A_SetPitch(Pitch-0.5)
			SSH4 L 1 A_ZoomFactor(0.73)
			SSH4 M 1 A_ZoomFactor(0.74)
			TNT1 A 1
			TNT1 A 1 A_ZoomFactor(0.75)
			TNT1 A 1 A_ZoomFactor(0.775)
			TNT1 A 1 A_ZoomFactor(0.8)
			TNT1 A 1 A_ZoomFactor(0.825)
			TNT1 A 1 A_ZoomFactor(0.85)
			TNT1 A 1 A_ZoomFactor(0.875)
			SSHO R 1 A_ZoomFactor(0.885)
			SSHO Q 1 A_ZoomFactor(0.895)
			SSHO P 1 A_ZoomFactor(0.9)
			SSHO O 1 A_ZoomFactor(0.91)
			SSHO N 1 A_ZoomFactor(0.92)
			SSHO M 1 A_ZoomFactor(0.93)
			SSHO L 1 A_ZoomFactor(0.94)
			SSHO K 1 A_ZoomFactor(0.95)
			SSHO J 1 A_ZoomFactor(0.96)
			SSHO I 1 A_ZoomFactor(0.97)
			SSHO H 1 A_ZoomFactor(0.98)
			SSHO G 1 A_ZoomFactor(0.99)
			SSHO F 1 A_ZoomFactor(1	)
			SSHO EDCBA 1
			SSHN GFEDCBA 1
			SSHG A 4 A_CheckReload 
			Goto Ready
		Reload:
			SSHG A 0 A_JumpIfInventory("QuadshotRecoilMode",1,"UnReload")
			SSHG A 0 A_Print("Recoil launch suppresion on.")
			SSHG A 0 A_GiveInventory("QuadshotRecoilMode",1)
			SSHG A 0 A_PlaySound("Quadshot/Mode",5,0.8)
			SSHG A 4
			SSHG A 4 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
			SSHG A 4 A_WeaponReady(WRF_NOSWITCH)
			Goto Ready
		UnReload:
			SSHG A 0 A_Print("Recoil launch suppresion off.")
			SSHG A 0 A_TakeInventory("QuadshotRecoilMode",1)
			SSHG A 0 A_PlaySound("Quadshot/Mode",5,0.8)
			SSHG A 4
			SSHG A 4 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
			SSHG A 4 A_WeaponReady(WRF_NOSWITCH)
			Goto Ready
			/*SSHN ABCDEFG 1
			SSHO ABCDEGIK 1
			SSHO M 1 A_PlaySound("Quadshot/Open",5,0.8)
			SSHO NOPQRSTUVWX 1
			SSHL A 3
			SSHL BCDE 1
			SSHL F 1 A_PlaySound("Quadshot/Load",6,0.65)
			SSHL GHIJ 1
			SSHL K 6
			SSHL LMNO 1
			SSHL P 1 A_PlaySound("Quadshot/Load",5,0.65)
			SSHL QRSTU 1
			SSHL V 6
			SSHC ABCDEF 1
			SSHO R 0 A_PlaySound("Quadshot/Close",6,0.8)
			SSHO RQPONMKIA 1
			SSHN GFEDCBA 1
			SSHG A 2
			SSHG A 3 A_ReFire*/
		Flash:
			TNT1 A 3 Bright
			TNT1 A 2 Bright
			Goto LightDone 
		}
}
	
ACTOR QuadshotRecoilMode : Inventory { Inventory.MaxAmount 1 }

ACTOR PointBlankBlast
{
  Radius 11
  Height 8
  Speed 60
  Damage 3000
  Projectile
  Obituary "%o was mutilated by %k's quad shotgun's point-blank shot."
  States
  {
  Spawn:
    TNT1 A 2
    Stop
  Death:
    Stop
  }
}

ACTOR PointBlankSuperDuperHiperBlast
{
  Radius 11
  Height 8
  Speed 60
  Damage 12000
  Projectile
  Obituary "%o was more than mutilated by %k's 4x4 shotgun's point-blank shot."
  States
  {
  Spawn:
    TNT1 A 2
    Stop
  Death:
    Stop
  }
}
